﻿using Grpc.Net.Client;
using GrpcOrder;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;

namespace RpcTest
{
    class Program
    {
        static async Task Main(string[] args)
        {
            // The port number(5001) must match the port of the gRPC server.
            var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client = new OrderService.OrderServiceClient(channel); 
            var reply = await client.QueryOrderListAsync(new OrderSearch() { Keyword="搜索条件"});
            Console.WriteLine("Greeting: " + reply.Orders.ToJson());
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
    }
}
